﻿namespace ShellNavigator.Client
{
  #region

  using System.Windows;
  using System.Windows.Input;

  #endregion

  /// <summary>
  ///     Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
    #region Constructors and Destructors

    public MainWindow()
    {
      this.InitializeComponent();
    }

    #endregion

    private void Window_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
    {
      if (e.Key == Key.Escape)
      {
        Application.Current.Shutdown();
      }
    }

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
      if (resultBox.Items.Count > 0)
      {
        //resultBox.SelectedIndex = 0;
        resultBox.Focus();
      }
    }

    private void Window_Closed(object sender, System.EventArgs e)
    {
      Application.Current.Shutdown();
    }
  }
}